import { kgjHttp as http } from '@/services/http';
import type { ListResult, Limit } from '@/types/api/common';
import type { GenCodeSearchParamsDTO, GenCodeListParamsDTO } from '@/types/api/crm-agency/gen-code';
// 兑换码查询
export const getGenCodeSearch = (params: GenCodeSearchParamsDTO) =>
  http<ListResult<any>>({
    method: 'get',
    url: '/api/gencode/search',
    params
  });
// 获取兑换码列表 -未出售
export const getGenCodeUnsoldList = (payload: { data: GenCodeListParamsDTO; params: Limit }) =>
  http({
    method: 'post',
    url: '/api/gencode/unsold/list',
    ...payload
  });

// 获取兑换码列表 -已出售
export const getGenCodeSoldList = (payload: { data: GenCodeListParamsDTO; params: Limit }) =>
  http({
    method: 'post',
    url: '/api/gencode/sold/list',
    ...payload
  });
